CC = gcc
CPP = g++
CFLAGS = -g -Wall
EXECUTABLES = dps

all: $(EXECUTABLES)

clean:
	rm -f core *.o $(EXECUTABLES)

.SUFFIXES: .c .cpp .o

IndirectBlock.o: IndirectBlock.cpp IndirectBlock.h
	$(CPP) $(CFLAGS) -c IndirectBlock.cpp

Directory.o: Directory.cpp Directory.h
	$(CPP) $(CFLAGS) -c  Directory.cpp 

File.o: File.cpp File.h
	$(CPP) $(CFLAGS) -c  File.cpp 

FSManager.o: FSManager.cpp FSManager.h Directory.h File.h Inode.h Superblock.h commands.h config.h IndirectBlock.h Tokenize.h Block.h
	$(CPP) $(CFLAGS) -c  FSManager.cpp

Inode.o: Inode.cpp Inode.h
	$(CPP) $(CFLAGS) -c  Inode.cpp

Superblock.o: Superblock.cpp Superblock.h config.h
	$(CPP) $(CFLAGS) -c  Superblock.cpp

Block.o: Block.cpp Block.h config.h
	$(CPP) $(CFLAGS) -c Block.cpp

delete_blocks.o: delete_blocks.cpp FSManager.h Inode.h commands.h config.h IndirectBlock.h
	$(CPP) $(CFLAGS) -c delete_blocks.cpp

mkfs.o: mkfs.cpp commands.h FSManager.h Superblock.h Inode.h config.h
	$(CPP) $(CFLAGS) -c  mkfs.cpp

open.o: open.cpp commands.h FSManager.h config.h File.h Inode.h commands.h
	$(CPP) $(CFLAGS) -c  open.cpp

close.o: close.cpp FSManager.h commands.h
	$(CPP) $(CFLAGS) -c  close.cpp

seek.o: seek.cpp FSManager.h File.h commands.h
	$(CPP) $(CFLAGS) -c  seek.cpp

write.o: write.cpp FSManager.h File.h commands.h config.h
	$(CPP) $(CFLAGS) -c write.cpp

read.o: read.cpp FSManager.h File.h commands.h config.h
	$(CPP) $(CFLAGS) -c  read.cpp

cat.o: cat.cpp FSManager.h File.h Inode.h commands.h
	$(CPP) $(CFLAGS) -c  cat.cpp

ls.o: ls.cpp FSManager.h Directory.h commands.h
	$(CPP) $(CFLAGS) -c  ls.cpp

tree.o: tree.cpp FSManager.h Directory.h commands.h Inode.h
	$(CPP) $(CFLAGS) -c tree.cpp

mkdir.o: mkdir.cpp FSManager.h Directory.h Inode.h commands.h
	$(CPP) $(CFLAGS) -c mkdir.cpp

rmdir.o: rmdir.cpp FSManager.h Directory.h File.h Inode.h commands.h config.h delete_blocks.o
	$(CPP) $(CFLAGS) -c rmdir.cpp

link.o: link.cpp FSManager.h Directory.h Inode.h commands.h
	$(CPP) $(CFLAGS) -c link.cpp

unlink.o: unlink.cpp FSManager.h Directory.h File.h Inode.h commands.h config.h delete_blocks.o
	$(CPP) $(CFLAGS) -c unlink.cpp

cd.o: cd.cpp FSManager.h Directory.h commands.h
	$(CPP) $(CFLAGS) -c cd.cpp

cp.o: cp.cpp FSManager.h Directory.h File.h Inode.h commands.h
	$(CPP) $(CFLAGS) -c cp.cpp

stat.o: stat.cpp FSManager.h Inode.h commands.h
	$(CPP) $(CFLAGS) -c stat.cpp

import.o: import.cpp FSManager.h Inode.h File.h Directory.h commands.h
	$(CPP) $(CFLAGS) -c import.cpp

export.o: export.cpp FSManager.h Inode.h File.h Directory.h commands.h
	$(CPP) $(CFLAGS) -c export.cpp

parse.o: parse.cpp FSManager.h commands.h Tokenize.h config.h
	$(CPP) $(CFLAGS) -c parse.cpp

Tokenize.o: Tokenize.cpp Tokenize.h
	$(CPP) $(CFLAGS) -c Tokenize.cpp

main.o: main.cpp FSManager.h commands.h config.h
	$(CPP) $(CFLAGS) -c main.cpp

dps: main.o Directory.o File.o Inode.o Superblock.o FSManager.o mkfs.o IndirectBlock.o Tokenize.o open.o close.o seek.o write.o read.o cat.o ls.o tree.o mkdir.o rmdir.o cd.o parse.o unlink.o delete_blocks.o link.o stat.o cp.o import.o export.o Block.o
	$(CPP) $(CFLAGS) -o dps main.o Directory.o File.o Inode.o Superblock.o FSManager.o mkfs.o IndirectBlock.o Tokenize.o open.o close.o seek.o write.o read.o cat.o ls.o tree.o mkdir.o rmdir.o cd.o parse.o unlink.o delete_blocks.o link.o stat.o cp.o import.o export.o Block.o
